package com.JingYan.Thread;

import java.util.concurrent.atomic.AtomicLong;

/**
 * 多线程生成唯一id
 *
 * @author Dong_Jia_Qi on 2022/6/5
 */
public class IdGenerator {
    AtomicLong var = new AtomicLong(0);

    public long getNextId() {
        return var.incrementAndGet();
    }
}
